home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
math
/
alged34.zip
/
ALGED.DOC
< prev
next >
Wrap
Text File
|
1996-06-06
|
13KB
|
280 lines
Tutorial for Algebra Editor John Henckel, henckel@vnet.ibm.com
Copyright (c) 1994,1996 John Henckel
Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation. All programs contained herein are provided
to you "as is". The implied warranties of merchantability and fitness
for a particular purpose are expressly disclaimed.
Getting Started
---------------
By now I assume you have downloaded the alged33.zip and unzipped it. You
should have the following files...
setup.bat <--- run this to change language and video
alged.exe <--- the program
alged.ae <--- sample data file
alged.1st <--- user options file
alged.doc <--- tutorial (this file)
algedeng.hlp <--- online help
algedeng.hlq <--- online help (graphics mode)
algedeng.mnu <--- menu, text and keyboard definitions
svga.ae <--- Super VGA 256 color option file
ned.ae <--- Flemish option file
fra.ae <--- French option file
algedned.* <--- Flemish language data
algedfra.* <--- French language data
algedsrc.zip <--- source code
file_id.diz <--- short description
vgaprtsc.* <--- TSR print screen utility for 16 color VGA graphics
*.bgi <--- various graphics drivers (Borland)
jhenck*.gif <--- some pictures of me
===> If you prefer Flemish (Dutch) see the file algedned.doc. <===
The default language of the Alged program is English and
the default graphics mode is "autodetect" up to 16 colors.
To change the defaults, type
setup
Before you run the Alged program, you might want to change the number of lines
on the screen. You can set this using the DOS command
MODE co80,43
When you start Alged you may specify one or more data files or option files.
The data file is just a text file you create with a text editor. Start Alged
with the sample data file...
alged alged
You can use option files SVGA, NED, and FRA to change the language or graphics
mode temporarily. For example.
alged alged svga
Now you should see a screen with a menu on the top and some formulas in the
middle. The first thing to learn is how to see the help text. Press F1.
The first part is a brief intro and how to use the mouse. Then you see a
description of each menu item. Notice that each menu item has a hotkey.
Graphics
--------
I know you all like graphics, so let's begin with some pretty pictures.
The first formula you see is the following...
2 2
cos(x*2) *cos(y*2) + r*0.2
What kind of function is this? What does it look like? A graph can help
you quickly understand the properties of a function. Click on Graph or
press 'g' to graph this in two dimensions. You see a cosine wave. This is
a cross-section of the function for values of x (because it is the first
variable in the function). To graph the other variables press 'V' (hold shift
key).
The curve is rather jagged, so press [home] twice to add more points. This
draws the function slower but smoother. Press [end] to remove points.
You can press [ins] and [del] to zoom in or out. You can press [pgup] and
[pgdn] to stretch the function. You can pan with the arrows. You can press
'd' to return to the default view.
3D graphics
-----------
Now let's look at a 3-dimensional graph. Press 'g' again. You may need to
press [home] or [end] to get a good picture. Press [ins] one time to get
closer. You can see that this is a function like many mountains in straight
rows. Initially, the x-axis is pointing towards you, z points to the right
and y points up. If you have a color display, press 'c'. Press 'f' to fill
the graph. Press 'f' again for a partially filled graph. Press 'c' again to
color the graph according the slope of the function, (see the ?r user option
for the slope direction vector).
If you are using SVGA mode with 256 colors here are some treats for you.
You can press 'x' to use a 240 color rainbow or 240 gray scale. You can use
the '-' and '=' key to cycle the palette. Press them multiple times to cycle
faster. The 'z' key will scale the palette according to the range of the
function so that all the colors are visible. To view a shaded 3D graph, go to
3D mode and press 'dfxxcc' and press [home] to add points.
What would happen if you wrap this mountain function over a sphere? Press
'a' to change to polar coordinates. You may want to press [ins] to get
closer. The tick marks on the axes are units. In polar mode, the x variable
determines the latitude, and y determines the longitude. The function value
is the radius. What about the other variable 'r'? It is a free variable
initially set to zero, (see upper left screen). You can change the value
of r by pressing 'w' and '2'. What happens when r is 3? when r is -13?
Press F1 while in graphics mode to see more help about graphics keys (or look
at the source code in algraph.c).
Parametric graphs
-----------------
Press Esc to return to the main menu. Now let's see a graph of a parametric
function. The next formula in the file is
cos(2*t) + sin(3*t + 0.2*u)
This formula describes the sound wave of a perfect fifth in music. Press down
arrow or click on the first '+' to select the formula, and press 'g' to graph
it. You can press 'w' and '2' to see the various phases.
What would happen if we plot the two components of this wave against each other
on the x and y axes? Press Esc to return to the main menu. Click on the sin
function with the left mouse button and click the cos function with the right
mouse button. (If you don't have a mouse, then press end, period, pgup, pgdn).
The cos function is copied to the "key" at the bottom of the screen. The key
is used as the x axis function. Press 'g' to view the graph, you should see
the shape of a fish. (If you don't see the fish press 'd' or 'a'). Now
change the phase of the sine and see the effect.
Parametric graphs can also be useful in 3D. The equation in the key is used
to warp or even overlap the x coordinates. You might try to put x + sin(y)
in the key and then select and view the "mountains" function again.
Entering Formulas
-----------------
Press Esc to return to the Alged main menu. To enter your own formula into
Alged, click on EnterKey or press 'k'. Type a formula at the prompt, for
example type...
x + sin(y)
then press F6 (or ctrl-Z) and press Enter. The formula appears at the bottom
of the screen in the "key". To move the key to the work space, click InsKey
or press 'Ins', and press Enter.
When you are entering formulas, you can use the following keys
arrows = redo and undo a character
Insert = toggle insert mode
Delete = delete one character
The Alged formulas are stored in plain text files, so you can use any text
editor to change or add formulas.
Solving Equations
-----------------
Let's start with the next sample formula.
x*(5 + 2*x) - 2
----------------- - 2*x + 1 = 13
3 + x
(It looks prettier than this if you use 8-bit ascii.) To solve this
problem, you need to find a common denominator for the left hand side.
You can either click on the "Comm Deno" menu item or press the hotkey 'm'.
The result is...
x*(5 + 2*x) - 2 - 2*x*(3 + x) + 1*(3 + x)
------------------------------------------- = 13
3 + x
To complete the problem do the following
1. click on Distribute or press 'd'
2. click on Simplify or press space
3. click on EquLeft or press '[' to move the 1 across the equal
4. click on EquRight or press ']' to move the 3 across the equal
5. click on Simplify or press space. You should see x = -2.92307692307692
6. click on Integer or press 'i' to convert to integer expression.
The answer is -38/13.
You may be thinking "that was a lot of trouble to just solve for x" and you
are right. Mathematica can do it in one step. But Alged is intentionally
this way. Rather than a long list of complicated transformations, Alged
provides and short list of simple commands and a highly interactive user
interface. This is conducive to "playing" with the formulas creatively.
The next problem is to find the intersection of a parabola and a circle.
In general, the solution would involve finding roots to a fourth degree
polynomial. This can be done, in theory, but for this tutorial we'll simplify
the problem by constraining two of the roots. Given a circle at the origin of
radius r, and given a parabola that passes through the circle at (r,0) and
(-r,0), at what other points does the parabola intersect the circle? The
equation of the circle is given by
2 2 2
(1) x + y = r
The general form of the parabola is given by
/ 2 2\
(2) y = a*\r - x /
To solve this we can eliminate y from (1) by substitution as follows
1. copy (2) to the Key by clicking on = with the right mouse button or
select it and press '.'.
2. select (1) by clicking on = with the left mouse button.
3. click on Substitut or press 'u'.
Subtract r^2 from both sides of (1) and simplify as follows
1. copy r^2 to the Key by clicking just ABOVE the r with the right mouse
button. If you don't have a mouse: pgdn, period, pgup.
2. click on Subtr Key or press '-'.
3. click on ^N Expand or press 'n'.
4. click on Distribut or press 'd'.
5. click on Simplify or press ' '.
Now we have a fourth degree polynomial. We know two of the roots: r, -r. So
we can reduce the equation by polynomial division.
1. copy (r^2 - x^2) to the key by clicking on the minus sign in (2) with
the right mouse button. Keyboard: down, pgdn, pgdn, period, up.
2. click on Div Key or press '/'.
3. press Enter to erase the key.
4. click on Poly Div or press '\'.
Now you should see the quotient plus the remainder fraction. In this case
the remainder reduces to zero after you distribute and simplify.
1. click on Distribut or press 'd'.
2. click on Simplify or press ' '.
Since the quotient is a second degree polynomial, we can solve it with the
quadratic equation.
1. click on FactQuad or press 'q'.
2. click on Simplify or press ' '.
3. Press shift 'D' to distribute each factor. (if you press 'd' you would
essentially undo the factorization).
4. click on Calculate or press 'c'.
5. click on Simplify or press ' '.
From the factored form of the polynomial you can see there are two roots.
To solve for one of them press EquRight, EquLeft, EquLeft (']' '[' '[') and
Simplify.
0.5
/ 2 2 \
\a *r - 1/
x = ----------------
a
The next little formula just demonstrates some arithmetic with complex numbers.
Select it and press 'c' to calculate. Both sides should be equal.
The remainder of the alged.ae file contains some sample problems for you to
play with. The last set of equations is the basis of another program I wrote
called Impact (available in http://www.coast.net/SimTel/msdos/simulatn.html).
Wrestling with these equations for several hours inspired be to write Alged.
If you enjoy Alged or have any suggestions, please send me an email.
I do not want you to send me any money, but I like to get mail.
"But because of his great love for us, God, who is rich in mercy, made us
alive with Christ even when we were dead in transgressions -- it is by
grace you have been saved. And God raise us up with Christ and seated us
with him in the heavenly realms in Christ Jesus, in order that in the coming
ages he might show the incomparable riches of his grace, expressed in his
kindness to us in Christ Jesus. For it is by grace you have been saved,
through faith -- and this not of yourselves, it is the gift of God -- not by
works, so that no one can boast. For we are God's workmanship, created in
Christ Jesus to do good works, which God prepared in advance for us to do."
Ephesians 2.4-10 NIV
John Henckel henckel@vnet.ibm.com